// 动作
const request = require('../utils/request')

export function getNavItem() {
  return request({
    url:"/getNavItem",
    method:"GET",
  })
}

export function submit(data:BaseData[]) {
  return request({
    url:"/submit",
    method:"POST",
    data
  })
}

export function getDataByDate(date:string) {
  return request({
    url:"/getDataByDate",
    method:"GET",
    data:{
      date
    }
  })
}

export function updateData(data:BaseData) {
  return request({
    url:"/updateData",
    method:"POST",
    data
  })
}

export function getTimesByDate(beginDate:string,endDate:string) {
  return request({
    url:"/getTimesByDate",
    method:"GET",
    data:{
      beginDate,
      endDate
    }
  })
}

export function getMoveTimesByDate(id:number, beginDate:string, endDate:string) {
  return request({
    url:"/getMoveTimesByDate",
    method:"GET",
    data:{
      id,
      beginDate,
      endDate
    }
  })
}

export function submitSuggest(data:Suggest) {
  return request({
    url:"/submitSuggest",
    method:"POST",
    data
  })
}

// 查找范围内的数据
export function getDataByDateRange(startDate:string, endDate:string) {
  return request({
    url:"/getDataByDateRange",
    method:"GET",
    data:{
      startDate,
      endDate
    }
  })
}